<!-- 系统自动生成 Date:2021-02-21 22:43 -->
<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增内部消息" bodyClass="white-bg" libs=["bootstrapSelect","fileupload","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">
<@f.form id="form-msg-add"  class="form-horizontal">
    <h4 class="form-header h4"><@ctx.i18n text = "基本信息"/>&nbsp;<i class="fa-fw fa fa-envelope-open"></i></h4>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <div class="form-group">
                    <label class="col-sm-4 control-label">
                        <span style="color: red; ">* </span>
                        <@ctx.i18n text = "收件人"/>：
                    </label>
                    <div class="col-sm-8">
                        <@f.tableselect name="userCode" required=true labelName="userCodeName" butClass="fa fa-fw fa-user-o" boxTitle="多选用户信息" tableInfo = "[{field:'username',title:'账号'},{field:'name',title:'姓名',query: true},{field:'compName',title:'归属公司'},
                   {field:'deptName',title:'归属机构'},{field:'email',title:'邮箱'},{field:'mobile',title:'手机号码'},
                   {field:'status',title:'状态',dict:'sys_user_show_hide',query: true},{field:'createTime',title:'创建时间'}]"  placeholder="请选择收件人" />
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <div class="form-group">
                    <label class="col-sm-4 control-label">
                        <span style="color: red; ">* </span>
                        <@ctx.i18n text = "抄送人"/>：
                    </label>
                    <div class="col-sm-8">
                        <@f.tableselect name="ccUserCode" labelName="ccUserCodeName" butClass="fa fa-fw fa-user-circle" boxTitle="多选用户信息" tableInfo = "[{field:'username',title:'账号'},{field:'name',title:'姓名',query: true},{field:'compName',title:'归属公司'},
                   {field:'deptName',title:'归属机构'},{field:'email',title:'邮箱'},{field:'mobile',title:'手机号码'},
                   {field:'status',title:'状态',dict:'sys_user_show_hide',query: true},{field:'createTime',title:'创建时间'}]"  placeholder="请选择抄送人" />
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label">
                    <span style="color: red; ">* </span>
                    <@ctx.i18n text = "消息等级"/>：
                </label>
                <div class="col-sm-8">
                    <@f.radio name="msgLevel" dictType="sys_notice_level"  required=true />
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label">
                    <span style="color: red; ">* </span>
                    <@ctx.i18n text = "是否开放评论"/>：
                </label>
                <div class="col-sm-8">
                    <@f.radio name="isComments" dictType="sys_msg_comments"  required=true />
                </div>
            </div>
        </div>
    </div>
    <div class="row">
<#--        <div class="col-sm-6">-->
<#--            <div class="form-group">-->
<#--                <label class="col-sm-4 control-label">-->
<#--                    <span style="color: red; ">* </span>-->
<#--                    <@ctx.i18n text = "发送者用户编码"/>：-->
<#--				</label>-->
<#--                <div class="col-sm-8">-->
<#--                    <@f.input name="sendUserCode"  required=true />-->
<#--                </div>-->
<#--            </div>-->
<#--        </div>-->
<#--        <div class="col-sm-6">-->
<#--            <div class="form-group">-->
<#--                <label class="col-sm-4 control-label">-->
<#--                    <span style="color: red; ">* </span>-->
<#--                    <@ctx.i18n text = "消息内容"/>：-->
<#--                </label>-->
<#--                <div class="col-sm-8">-->
<#--                    <@f.input name="msgContent"  required=true />-->
<#--                </div>-->
<#--            </div>-->
<#--        </div>-->
        <div class="col-sm-12">
            <div class="form-group">
                <label class="col-sm-2 control-label">
                    <span style="color: red; ">* </span>
                    <@ctx.i18n text = "主题"/>：
                </label>
                <div class="col-sm-10">
                    <@f.input name="msgTitle"  required=true />
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="form-group">
                <label class="col-sm-2 control-label"><span style="color: red; ">*</span>正文：</label>
                <div class="col-sm-10">
                    <@f.ueditor name="msgContent" toolbars="'simpleupload','fullscreen'" />
                </div>
            </div>
        </div>
    </div>
    <h4 class="form-header h4"><@ctx.i18n text = "附件上传"/>&nbsp;<i class="fa-fw fa icon-cloud-upload"></i></h4>
    <div class="row">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-2 control-label"><@ctx.i18n text = "附件上传"/>：
                </label>
                <div class="col-sm-10">
                    <@f.fileupload name="upload_file" bizType="sys_msg_push_file" isLazy=true preview="true" uploadType="all"/>
                </div>
            </div>
        </div>
    </div>
</@f.form>
<div class="hr-line-dashed"></div>
<div class="row" id="_addTab">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-success" onclick="opt.form.submit()"><i class="fa ion-android-drafts"></i> <@ctx.i18n text = "保存草稿"/></button>&nbsp;
        <button type="button" class="btn btn-sm btn-primary" onclick="opt.form.submit()"><i class="fa fa-send"></i> <@ctx.i18n text = "发送"/></button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="opt.modal.closeTab()"><i class="fa fa-reply-all"></i> <@ctx.i18n text = "取消"/></button>
    </div>
</div>
</div>
<@footer>
<script type="text/javascript">
    var prefix = baseURL + "sys/msg";
    /**表单验证*/
    <@compress single_line=true>
    $("#form-msg-add").validate({
        focusCleanup: true
    });
    </@compress>


    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.saveTab(prefix + "/add", $('#form-msg-add').serialize());
        }
    }

    // function tableCallback(id,event,index, layero,data){
    //     if(id == "userCode"){
    //         // $("#userCodeName").val()
    //         console.log(data);
    //     }
    // }
</script>
</@footer>
</@pageTheme>